#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long
#define uint unsigned int
#define endl '\n'

const int INF = 1e9;
const int MOD = 998244353;

#define MAX_VEX 1000
#define DIRECTED false
#define YES cout << "YES" << '\n'
#define NO cout << "NO" << '\n'

using namespace std;

/*思考

*/
int a[1005][1005]={0};
void add(int x1,int y1,int x2,int y2){
    a[x1][y1]+=1;
    a[x1][y2+1]-=1;
    a[x2+1][y1]-=1;
    a[x2+1][y2+1]+=1;
}
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n,m,x1,y1,x2,y2;
    cin>>n>>m;
    for(int i=1;i<=m;i++){
        cin>>x1>>y1>>x2>>y2;
        add(x1,y1,x2,y2);
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            a[i][j]+=a[i][j-1]+a[i-1][j]-a[i-1][j-1];
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            cout<<a[i][j]<<' ';
        }
        cout<<endl;
    }
    return 0;
}